import React from "react";
import { Switch, Route, Redirect } from "react-router-dom";
import Login from "./pages/Login/Login";
import List from "./pages/List/List";
import Register from "./pages/Register/Register";
import Detail from "./pages/Detail/Detail";
import Search from "./pages/Search/Search";
import Home from "./pages/Home/Home";
import PrivateRoute from "./utils/Private";
export default function App() {
  return (
    <div>
      <Switch>
        <Route path="/login" component={Login}></Route>
        <Route path="/register" component={Register}></Route>
        <PrivateRoute path="/index" component={Home}></PrivateRoute>
        <PrivateRoute path="/list" component={List}></PrivateRoute>
        <PrivateRoute path="/detail/:id/:type" component={Detail}></PrivateRoute>
        <PrivateRoute path="/search" component={Search}></PrivateRoute>
        <Redirect to="/login"></Redirect>
      </Switch>
    </div>
  );
}
